package com.zcgk.core.exception;

import com.zcgk.core.domain.CodeMsg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/****************************************************
 *
 * 自定义异常类
 *
 *
 * @author Francis
 * @date 2020/2/4 23:46
 * @version 1.0
 **************************************************/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("自定义异常类")
public class CosyException extends RuntimeException {

    @ApiModelProperty("错误信息代码")
    private Integer code;

    @ApiModelProperty("错误信息")
    private String msg;


    public CosyException(CodeMsg codeMsg){
        this.code = codeMsg.getCode();
        this.msg = codeMsg.getMsg();
    }
}
